<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        /* 块：独占一行，宽度默认是是父级的100%，添加宽度都生效 */
        div {
            width: 300px;
            height: 300px;
            background-color: pink;

            /* 行内块：在一行显示，设置宽高都生效 */
            /* display: inline-block;*/

            /* 转换为行内：设置宽高不生效 */
            /* display: inline;*/

            /* 转换为块：宽高生效，只是都独占一行 */
            display: block;
        }

    </style>
</head>
<body>

    <div>111</div>
    <div>222</div>
</body>
</html>